package com.xszx.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xszx.entity.TAsset;
import com.xszx.entity.dto.AssetCheck;
import com.xszx.service.TAssetService;
import com.xszx.mapper.TAssetMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 34129
* @description 针对表【t_asset】的数据库操作Service实现
* @createDate 2024-01-08 20:40:47
*/
@Service
public class TAssetServiceImpl extends ServiceImpl<TAssetMapper, TAsset>
    implements TAssetService{

    @Autowired
    private TAssetMapper assetMapper;

    @Override
    public List<TAsset> selectAssetList(long did) {
       List<TAsset> assetList =  assetMapper.selectAssetList(did);

        return assetList;
    }

    @Override
    public List<TAsset> selectAssetLists() {
        return assetMapper.selectAssetLists();
    }

    @Override
    public int deleteAssetById(long id) {
        int result = assetMapper.deleteById(id);
        return result;
    }

    @Override
    public int addAsset(TAsset asset) {
       int result = assetMapper.insert(asset);
      //  int result = assetMapper.addAsset(asset);
        return result;
    }

    @Override
    public int updateAsset(TAsset asset) {
        int result = assetMapper.updateById(asset);
        return result;
    }

    @Override
    public TAsset getAssetByAid(Long aid,Long did) {
        TAsset tAsset = assetMapper.selectById(aid,did);
        return tAsset;
    }

    @Override
    public TAsset selectAssetByAid(long aid, long did) {
        return assetMapper.selectAssetByAid(aid,did);
    }

    @Override
    public List<TAsset> selectAssetListUsing(Long did) {
        List<TAsset> assetList =  assetMapper.selectAssetListUsing(did);
        return assetList;
    }

    @Override
    public List<TAsset> selectAssetListForbidden(Long did) {
        List<TAsset> assetList =  assetMapper.selectAssetListForbidden(did);
        return assetList;
    }

    @Override
    public List<TAsset> selectAssetListScrap(Long did) {
        List<TAsset> assetList =  assetMapper.selectAssetListScrap(did);
        return assetList;
    }

    @Override
    public List<TAsset> selectAssetListFree(Long did) {
        List<TAsset> assetList =  assetMapper.selectAssetListFree(did);
        return assetList;
    }

    @Override
    public List<TAsset> selectAssetListFix(Long did) {
        List<TAsset> assetList =  assetMapper.selectAssetListFix(did);
        return assetList;
    }

    @Override
    public int updateAstatusByAid(long aid, String astatus) {
        return assetMapper.updateAstatusByAid(aid, astatus);
    }

    @Override
    public TAsset selectAssetByAcode(long acode) {
        return assetMapper.selectAssetByAcode(acode);
    }


    @Override
    public List<TAsset> selectAssetsByCheck(AssetCheck assetCheck) {
        return assetMapper.selectAssetsByCheck(assetCheck);
    }


}




